﻿<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                    xmlns:controls="clr-namespace:Corina.Controls.Silverlight;assembly=Corina.Controls.Silverlight"
                    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
                    xmlns:ei="http://schemas.microsoft.com/expression/2010/interactions"
                    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
                    mc:Ignorable="d">

    <ResourceDictionary.MergedDictionaries>
        <ResourceDictionary Source="Brushes.xaml" />
        <ResourceDictionary Source="../Icons.xaml" />
    </ResourceDictionary.MergedDictionaries>

    <Style x:Key="FirstPageButtonStyle" TargetType="Button">
        <Setter Property="Width" Value="25" />
        <Setter Property="Height" Value="25" />
        <Setter Property="Background" Value="{StaticResource GrayBrush3}" />
        <Setter Property="Foreground" Value="{StaticResource TextBrush}" />
        <Setter Property="BorderBrush" Value="{StaticResource TextBoxBorderBrush}" />
        <Setter Property="Padding" Value="3" />
        <Setter Property="BorderThickness" Value="1" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="Button">
                    <Grid>

                        <VisualStateManager.VisualStateGroups>
                            <VisualStateGroup x:Name="CommonStates" ei:ExtendedVisualStateManager.UseFluidLayout="True">
                                <VisualStateGroup.Transitions>
                                    <VisualTransition GeneratedDuration="0:0:0.3" />
                                </VisualStateGroup.Transitions>
                                <VisualState x:Name="Pressed">
                                    <Storyboard>
                                        <DoubleAnimation Duration="0"
                                                         Storyboard.TargetName="ellipse"
                                                         Storyboard.TargetProperty="(UIElement.Opacity)"
                                                         To="0.4"
                                                         d:IsOptimized="True" />
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="MouseOver">
                                    <Storyboard>
                                        <DoubleAnimation Duration="0"
                                                         Storyboard.TargetName="ellipse"
                                                         Storyboard.TargetProperty="(UIElement.Opacity)"
                                                         To="0.6"
                                                         d:IsOptimized="True" />
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Normal" />
                                <VisualState x:Name="Disabled">
                                    <Storyboard>
                                        <DoubleAnimation Duration="0"
                                                         Storyboard.TargetName="ellipse"
                                                         Storyboard.TargetProperty="(UIElement.Opacity)"
                                                         To="0.2"
                                                         d:IsOptimized="True" />
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                        </VisualStateManager.VisualStateGroups>

                        <VisualStateManager.CustomVisualStateManager>
                            <ei:ExtendedVisualStateManager />
                        </VisualStateManager.CustomVisualStateManager>

                        <Grid Width="8"
                              Height="9"
                              Opacity="0.7">
                            <Path Width="5"
                                  Height="9"
                                  HorizontalAlignment="Right"
                                  Data="M0,1 L1,0 L1,2 Z"
                                  Fill="{StaticResource CheckBoxMouseOverBrush}"
                                  Stretch="Fill" />
                            <Rectangle Width="2"
                                       HorizontalAlignment="Left"
                                       Fill="{StaticResource CheckBoxMouseOverBrush}" />
                        </Grid>
                        <Ellipse x:Name="ellipse"
                                 Fill="Transparent"
                                 Opacity="0.3"
                                 Stroke="{StaticResource CheckBoxMouseOverBrush}" />
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style x:Key="PreviousPageButtonStyle" TargetType="Button">
        <Setter Property="Width" Value="25" />
        <Setter Property="Height" Value="25" />
        <Setter Property="Background" Value="{StaticResource GrayBrush3}" />
        <Setter Property="Foreground" Value="{StaticResource TextBrush}" />
        <Setter Property="BorderBrush" Value="{StaticResource TextBoxBorderBrush}" />
        <Setter Property="Padding" Value="3" />
        <Setter Property="BorderThickness" Value="1" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="Button">
                    <Grid>
                        <VisualStateManager.VisualStateGroups>
                            <VisualStateGroup x:Name="CommonStates" ei:ExtendedVisualStateManager.UseFluidLayout="True">
                                <VisualStateGroup.Transitions>
                                    <VisualTransition GeneratedDuration="0:0:0.3" />
                                </VisualStateGroup.Transitions>
                                <VisualState x:Name="Pressed">
                                    <Storyboard>
                                        <DoubleAnimation Duration="0"
                                                         Storyboard.TargetName="ellipse"
                                                         Storyboard.TargetProperty="(UIElement.Opacity)"
                                                         To="0.4"
                                                         d:IsOptimized="True" />
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="MouseOver">
                                    <Storyboard>
                                        <DoubleAnimation Duration="0"
                                                         Storyboard.TargetName="ellipse"
                                                         Storyboard.TargetProperty="(UIElement.Opacity)"
                                                         To="0.6"
                                                         d:IsOptimized="True" />
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Normal" />
                                <VisualState x:Name="Disabled">
                                    <Storyboard>
                                        <DoubleAnimation Duration="0"
                                                         Storyboard.TargetName="ellipse"
                                                         Storyboard.TargetProperty="(UIElement.Opacity)"
                                                         To="0.2"
                                                         d:IsOptimized="True" />
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                        </VisualStateManager.VisualStateGroups>

                        <VisualStateManager.CustomVisualStateManager>
                            <ei:ExtendedVisualStateManager />
                        </VisualStateManager.CustomVisualStateManager>
                        <Path Width="5"
                              Height="9"
                              HorizontalAlignment="Center"
                              Data="M0,1 L1,0 L1,2 Z"
                              Fill="{StaticResource CheckBoxMouseOverBrush}"
                              Opacity="0.7"
                              Stretch="Fill" />
                        <Ellipse x:Name="ellipse"
                                 Fill="Transparent"
                                 Opacity="0.3"
                                 Stroke="{StaticResource CheckBoxMouseOverBrush}" />
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style x:Key="NextPageButtonStyle" TargetType="Button">
        <Setter Property="Width" Value="25" />
        <Setter Property="Height" Value="25" />
        <Setter Property="Background" Value="{StaticResource GrayBrush3}" />
        <Setter Property="Foreground" Value="{StaticResource TextBrush}" />
        <Setter Property="BorderBrush" Value="{StaticResource TextBoxBorderBrush}" />
        <Setter Property="Padding" Value="3" />
        <Setter Property="BorderThickness" Value="1" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="Button">
                    <Grid>
                        <VisualStateManager.VisualStateGroups>
                            <VisualStateGroup x:Name="CommonStates" ei:ExtendedVisualStateManager.UseFluidLayout="True">
                                <VisualStateGroup.Transitions>
                                    <VisualTransition GeneratedDuration="0:0:0.3" />
                                </VisualStateGroup.Transitions>
                                <VisualState x:Name="Pressed">
                                    <Storyboard>
                                        <DoubleAnimation Duration="0"
                                                         Storyboard.TargetName="ellipse"
                                                         Storyboard.TargetProperty="(UIElement.Opacity)"
                                                         To="0.4"
                                                         d:IsOptimized="True" />
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="MouseOver">
                                    <Storyboard>
                                        <DoubleAnimation Duration="0"
                                                         Storyboard.TargetName="ellipse"
                                                         Storyboard.TargetProperty="(UIElement.Opacity)"
                                                         To="0.6"
                                                         d:IsOptimized="True" />
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Normal" />
                                <VisualState x:Name="Disabled">
                                    <Storyboard>
                                        <DoubleAnimation Duration="0"
                                                         Storyboard.TargetName="ellipse"
                                                         Storyboard.TargetProperty="(UIElement.Opacity)"
                                                         To="0.2"
                                                         d:IsOptimized="True" />
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                        </VisualStateManager.VisualStateGroups>

                        <VisualStateManager.CustomVisualStateManager>
                            <ei:ExtendedVisualStateManager />
                        </VisualStateManager.CustomVisualStateManager>

                        <Path Width="5"
                              Height="9"
                              HorizontalAlignment="Center"
                              Data="M0,0 L1,1 L0,2 Z"
                              Fill="{StaticResource CheckBoxMouseOverBrush}"
                              Opacity="0.7"
                              Stretch="Fill" />
                        <Ellipse x:Name="ellipse"
                                 Fill="Transparent"
                                 Opacity="0.3"
                                 Stroke="{StaticResource CheckBoxMouseOverBrush}" />
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style x:Key="LastPageButtonStyle" TargetType="Button">
        <Setter Property="Width" Value="25" />
        <Setter Property="Height" Value="25" />
        <Setter Property="Background" Value="{StaticResource GrayBrush3}" />
        <Setter Property="Foreground" Value="{StaticResource TextBrush}" />
        <Setter Property="BorderBrush" Value="{StaticResource TextBoxBorderBrush}" />
        <Setter Property="Padding" Value="3" />
        <Setter Property="BorderThickness" Value="1" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="Button">
                    <Grid>
                        <VisualStateManager.VisualStateGroups>
                            <VisualStateGroup x:Name="CommonStates" ei:ExtendedVisualStateManager.UseFluidLayout="True">
                                <VisualStateGroup.Transitions>
                                    <VisualTransition GeneratedDuration="0:0:0.3" />
                                </VisualStateGroup.Transitions>
                                <VisualState x:Name="Pressed">
                                    <Storyboard>
                                        <DoubleAnimation Duration="0"
                                                         Storyboard.TargetName="ellipse"
                                                         Storyboard.TargetProperty="(UIElement.Opacity)"
                                                         To="0.4"
                                                         d:IsOptimized="True" />
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="MouseOver">
                                    <Storyboard>
                                        <DoubleAnimation Duration="0"
                                                         Storyboard.TargetName="ellipse"
                                                         Storyboard.TargetProperty="(UIElement.Opacity)"
                                                         To="0.6"
                                                         d:IsOptimized="True" />
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Normal" />
                                <VisualState x:Name="Disabled">
                                    <Storyboard>
                                        <DoubleAnimation Duration="0"
                                                         Storyboard.TargetName="ellipse"
                                                         Storyboard.TargetProperty="(UIElement.Opacity)"
                                                         To="0.2"
                                                         d:IsOptimized="True" />
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                        </VisualStateManager.VisualStateGroups>

                        <VisualStateManager.CustomVisualStateManager>
                            <ei:ExtendedVisualStateManager />
                        </VisualStateManager.CustomVisualStateManager>

                        <Grid Width="8"
                              Height="9"
                              Opacity="0.7">
                            <Path Width="5"
                                  Height="9"
                                  HorizontalAlignment="Left"
                                  Data="M0,0 L1,1 L0,2 Z"
                                  Fill="{StaticResource CheckBoxMouseOverBrush}"
                                  Stretch="Fill" />
                            <Rectangle Width="2"
                                       HorizontalAlignment="Right"
                                       Fill="{StaticResource CheckBoxMouseOverBrush}" />
                        </Grid>
                        <Ellipse x:Name="ellipse"
                                 Fill="Transparent"
                                 Opacity="0.3"
                                 Stroke="{StaticResource CheckBoxMouseOverBrush}" />
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style x:Key="SwapRightButtonStyle" TargetType="Button">
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="Button">
                    <Grid>
                        <Grid Background="White" Opacity="0" />
                        <Path Width="16"
                              Height="16"
                              Margin="6"
                              Data="{Binding Converter={StaticResource StringToPathGeometryConverter},
                                             Source={StaticResource ICON_SWAPRIGHT}}"
                              Fill="{StaticResource ControlBorderBrush}"
                              RenderTransformOrigin="0.5,0.5"
                              Stretch="Uniform">
                            <Path.RenderTransform>
                                <TransformGroup>
                                    <TransformGroup.Children>
                                        <RotateTransform Angle="0" />
                                        <ScaleTransform ScaleX="1" ScaleY="1" />
                                    </TransformGroup.Children>
                                </TransformGroup>
                            </Path.RenderTransform>
                        </Path>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style x:Key="SwapLeftButtonStyle" TargetType="Button">
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="Button">
                    <Grid>
                        <Grid Background="White" Opacity="0" />
                        <Path Width="16"
                              Height="16"
                              Margin="6"
                              Data="{Binding Converter={StaticResource StringToPathGeometryConverter},
                                             Source={StaticResource ICON_SWAPLEFT}}"
                              Fill="{StaticResource ControlBorderBrush}"
                              RenderTransformOrigin="0.5,0.5"
                              Stretch="Uniform">
                            <Path.RenderTransform>
                                <TransformGroup>
                                    <TransformGroup.Children>
                                        <RotateTransform Angle="0" />
                                        <ScaleTransform ScaleX="1" ScaleY="1" />
                                    </TransformGroup.Children>
                                </TransformGroup>
                            </Path.RenderTransform>
                        </Path>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style x:Key="CheckButtonStyle" TargetType="Button">
        <Setter Property="Foreground" Value="{StaticResource HighlightBrush}" />
        <Setter Property="Height" Value="16" />
        <Setter Property="Width" Value="16" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="Button">
                    <Grid>
                        <Rectangle Fill="White" Opacity="0" />
                        <Path Width="{TemplateBinding Width}"
                              Height="{TemplateBinding Height}"
                              Margin="0,0,0,0"
                              Data="{Binding Source={StaticResource ICON_CHECK},
                                             Converter={StaticResource StringToPathGeometryConverter}}"
                              Fill="{TemplateBinding Foreground}"
                              RenderTransformOrigin="0.5,0.5"
                              Stretch="Uniform">
                            <Path.RenderTransform>
                                <TransformGroup>
                                    <TransformGroup.Children>
                                        <RotateTransform Angle="0" />
                                        <ScaleTransform ScaleX="1" ScaleY="1" />
                                    </TransformGroup.Children>
                                </TransformGroup>
                            </Path.RenderTransform>
                        </Path>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style x:Key="CrossButtonStyle" TargetType="Button">
        <Setter Property="Foreground" Value="{StaticResource HighlightBrush}" />
        <Setter Property="Height" Value="16" />
        <Setter Property="Width" Value="16" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="Button">
                    <Grid>
                        <Rectangle Fill="White" Opacity="0" />
                        <Path Width="{TemplateBinding Width}"
                              Height="{TemplateBinding Height}"
                              Margin="0,0,0,0"
                              Data="{Binding Source={StaticResource ICON_CLOSE},
                                             Converter={StaticResource StringToPathGeometryConverter}}"
                              Fill="{TemplateBinding Foreground}"
                              RenderTransformOrigin="0.5,0.5"
                              Stretch="Uniform">
                            <Path.RenderTransform>
                                <TransformGroup>
                                    <TransformGroup.Children>
                                        <RotateTransform Angle="0" />
                                        <ScaleTransform ScaleX="1" ScaleY="1" />
                                    </TransformGroup.Children>
                                </TransformGroup>
                            </Path.RenderTransform>
                        </Path>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style x:Key="EditButtonStyle" TargetType="Button">
        <Setter Property="Foreground" Value="{StaticResource HighlightBrush}" />
        <Setter Property="Height" Value="16" />
        <Setter Property="Width" Value="16" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="Button">
                    <Grid>
                        <Rectangle Fill="White" Opacity="0" />
                        <Path Width="{TemplateBinding Width}"
                              Height="{TemplateBinding Height}"
                              Margin="0,0,0,0"
                              Data="{Binding Source={StaticResource ICON_EDIT},
                                             Converter={StaticResource StringToPathGeometryConverter}}"
                              Fill="{TemplateBinding Foreground}"
                              RenderTransformOrigin="0.5,0.5"
                              Stretch="Uniform">
                            <Path.RenderTransform>
                                <TransformGroup>
                                    <TransformGroup.Children>
                                        <RotateTransform Angle="0" />
                                        <ScaleTransform ScaleX="1" ScaleY="1" />
                                    </TransformGroup.Children>
                                </TransformGroup>
                            </Path.RenderTransform>
                        </Path>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style x:Key="DeleteButtonStyle" TargetType="Button">
        <Setter Property="Foreground" Value="{StaticResource HighlightBrush}" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="Button">
                    <Grid>
                        <Rectangle Fill="White" Opacity="0" />
                        <Path Width="16"
                              Height="16"
                              Margin="0,0,0,0"
                              Data="{Binding Source={StaticResource ICON_GARBAGE},
                                             Converter={StaticResource StringToPathGeometryConverter}}"
                              Fill="{TemplateBinding Foreground}"
                              RenderTransformOrigin="0.5,0.5"
                              Stretch="Uniform">
                            <Path.RenderTransform>
                                <TransformGroup>
                                    <TransformGroup.Children>
                                        <RotateTransform Angle="0" />
                                        <ScaleTransform ScaleX="1" ScaleY="1" />
                                    </TransformGroup.Children>
                                </TransformGroup>
                            </Path.RenderTransform>
                        </Path>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style x:Key="RefreshButton" TargetType="Button">
        <Setter Property="Foreground" Value="{StaticResource HighlightBrush}" />
        <Setter Property="Height" Value="16" />
        <Setter Property="Width" Value="16" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="Button">
                    <Grid>
                        <Rectangle Fill="White" Opacity="0" />
                        <Path Width="{TemplateBinding Width}"
                              Height="{TemplateBinding Height}"
                              Margin="0,0,0,0"
                              Data="{Binding Source={StaticResource ICON_COMMAND_REFRESH},
                                             Converter={StaticResource StringToPathGeometryConverter}}"
                              Fill="{TemplateBinding Foreground}"
                              RenderTransformOrigin="0.5,0.5"
                              Stretch="Uniform">
                            <Path.RenderTransform>
                                <TransformGroup>
                                    <TransformGroup.Children>
                                        <RotateTransform Angle="0" />
                                        <ScaleTransform ScaleX="1" ScaleY="1" />
                                    </TransformGroup.Children>
                                </TransformGroup>
                            </Path.RenderTransform>
                        </Path>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style TargetType="controls:PathButton">
        <Setter Property="Width" Value="20" />
        <Setter Property="Height" Value="20" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="controls:PathButton">
                    <Grid>
                        <Grid Background="White" Opacity="0" />
                        <Path Width="{TemplateBinding Width}"
                              Height="{TemplateBinding Height}"
                              Margin="0,0,0,0"
                              Data="{Binding PathData,
                                             Converter={StaticResource StringToPathGeometryConverter},
                                             RelativeSource={RelativeSource TemplatedParent}}"
                              Fill="{TemplateBinding Foreground}"
                              RenderTransformOrigin="0.5,0.5"
                              Stretch="Uniform">
                            <Path.RenderTransform>
                                <TransformGroup>
                                    <TransformGroup.Children>
                                        <RotateTransform Angle="0" />
                                        <ScaleTransform ScaleX="1" ScaleY="1" />
                                    </TransformGroup.Children>
                                </TransformGroup>
                            </Path.RenderTransform>
                        </Path>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
</ResourceDictionary>
